#pragma once
#include "UltimateSubsystemRegistryPrecompiled.h"
#include "UltimateSubsystemRegistry.h"





	template<> UltimateSubsystemRegistry* Ogre::Singleton<UltimateSubsystemRegistry>::msSingleton = 0;

	UltimateSubsystemRegistry* UltimateSubsystemRegistry::getSingletonPtr(void)
	{
		return msSingleton;
	}
	UltimateSubsystemRegistry& UltimateSubsystemRegistry::getSingleton(void)
	{  
		assert( msSingleton );  return ( *msSingleton );  
	}

	UltimateSubsystemRegistry::UltimateSubsystemRegistry(void)
	{
	}


	UltimateSubsystemRegistry::~UltimateSubsystemRegistry(void)
	{
	}
	
	
	void UltimateSubsystemRegistry::addSubsystem(UltimateSubsystem* subsystem)
	{
		subsystemMap[subsystem->getSubsystemName()] = subsystem;
	}

	void UltimateSubsystemRegistry::removeSubsystem(Ogre::String subsystemName)
	{
		subsystemMap.erase(subsystemName);
	}

	UltimateSubsystem * UltimateSubsystemRegistry::getSubsystem(Ogre::String subsystemName)
	{
		
		std::map<Ogre::String, UltimateSubsystem*>::iterator foundSubsysIterator  =subsystemMap.find(subsystemName);
		if(foundSubsysIterator!= subsystemMap.end())
		{
			return subsystemMap[subsystemName];
		}
		else
		{
			return 0;
		}
	}


	
